cmake_minimum_required(VERSION 3.5)
set(CMAKE_POLICY_DEFAULT_CMP0079 NEW)
project(opcclient VERSION 0.5.2 LANGUAGES CXX)

set(OPCDACLIENT_STATIC FALSE CACHE BOOL "Build static library version")
set(OPCDACLIENT_TESTING FALSE CACHE BOOL "Build test application")

add_definitions(-DWIN32_LEAN_AND_MEAN)
add_subdirectory(OPCClientToolKit)
if (OPCDACLIENT_TESTING)
  add_subdirectory(OPCClientDemo)
  add_subdirectory(OPCPerformance)
  add_subdirectory(LocalSyncWrapper)
endif()

set(CPACK_PACKAGE_VENDOR ${project})
set(CPACK_PACKAGE_NAME ${project})
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${CMAKE_GENERATOR_PLATFORM})
if (OPCDACLIENT_STATIC)
  set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}-static)
endif()
include(CPack)
